package com.cybersapien.comng.engine.event.engine;

import com.cybersapien.comng.engine.action.IAction;
import com.cybersapien.comng.engine.event.IEventActor;
import com.cybersapien.comng.engine.event.IEventTarget;
import com.cybersapien.comng.engine.type.Parameters;

public abstract class EventEngineBase implements IEventEngine {

	private static final long serialVersionUID = 4354618140970330216L;

	String id;
	String worldID;
	SCOPE scope;
	TYPE type;
	IEventActor actor;
	IEventTarget target;
	Parameters<Object> parameters;
	boolean canceled;

	public EventEngineBase(IAction action, IAction.ActionParams params) {

	}

	public EventEngineBase(String id, String worldID, SCOPE scope, TYPE type, IEventActor actor, IEventTarget target) {
		super();
		this.id = id;
		this.worldID = worldID;
		this.scope = scope;
		this.type = type;
		this.actor = actor;
		this.target = target;
		this.parameters = new Parameters<Object>();
		this.canceled = false;
	}

	/* ====== GETTER AND SETTERS ====== */

	@Override
	public String getID() {
		return id;
	}

	@Override
	public String getWorldID() {
		return worldID;
	}

	@Override
	public SCOPE getScope() {
		return scope;
	}

	@Override
	public TYPE getType() {
		return type;
	}

	public void setType(TYPE type) {
		this.type = type;
	}

	@Override
	public IEventActor getActor() {
		return actor;
	}

	public void setActor(IEventActor actor) {
		this.actor = actor;
	}

	@Override
	public IEventTarget getTarget() {
		return target;
	}

	public void setTarget(IEventTarget target) {
		this.target = target;
	}

	public Object getParameter(String name) {
		return this.parameters.get(name);
	}

	public void setParameter(String name, Object value) {
		this.parameters.put(name, value);
	}

	public boolean isCanceled() {
		return this.canceled;
	}

	protected void setCanceled(boolean canceled) {
		this.canceled = canceled;
	}

	/* ====== */

}
